package com.ytktt.study.week8.task6.shardingsphere.atomikosxa.service;

import com.ytktt.study.week8.task6.shardingsphere.atomikosxa.entity.item.ItemStockEntity;

/**
 * 商品服务业务逻辑抽象
 *
 * @author ytk
 */
public interface ItemService {

    /**
     * 获取商品库存
     *
     * @param itemId the item id
     * @return the item stock
     */
    ItemStockEntity getItemStock(int itemId);

    /**
     * 扣商品库存
     *
     * @param itemId the item id
     * @param amount the amount
     * @return the boolean
     */
    boolean decreItemStock(int itemId, int amount);
}
